<%-- 
    Document   : AddToFavorites
    Created on : May 22, 2010, 4:06:57 PM
    Author     : vasi
--%>
<%@page import="entities.*" %>
<%ContentEntity content = (ContentEntity)request.getAttribute("content");%>
<%ContentFavoritesEntity favorite = (ContentFavoritesEntity)request.getAttribute("favorite"); %>
<% if (favorite == null){%>
    <form id="add_to_favorite_form_id" name="add_to_favorite_form" action="<% out.print(request.getContextPath()); %>/content/addfavorite" method="POST">
        <a href="" onclick="$('#add_to_favorite_form_id').trigger('submit'); return false;">Add to Favorites</a>
        <input type="hidden" value="<%= content.getCid()%>" name="cid" />
        <input type="hidden" value="submitted" name="submitted" />
    </form>
<%} else {
    out.print("<div>The content belongs to your favorites list.</div>");
}%>
